<template>
	<view class="pages">
		<view class="h1">
			<text>欢迎来到蔡阿姨的红娘馆</text>
		</view>
		<view class="u-flex-y-center line_height">
			<image src="/static/tick.png" class="tick"></image>
			<text>平台仅提供展示使用</text>
		</view>
		<view class="u-flex-y-center line_height">
			<image src="/static/tick.png" class="tick"></image>
			<text>所展示信息均通过本人书面授权同意</text>
		</view>
		<view class="u-flex-y-center line_height">
			<image src="/static/tick.png" class="tick"></image>
			<text>100%保障用户信息安全</text>
		</view>
		<view class="login_page">
			<image src="https://hl-1316403513.cos.ap-shanghai.myqcloud.com/static/%E7%99%BB%E5%BD%95%E9%A1%B5%E6%8F%92%E5%9B%BE.png"></image>
		</view>
		<button class="btn_login u-flex-xy-center" @click="login" :disabled="!is_agree"
			:style="{opacity:is_agree?'1':'0.5'}">
			<text>
				微信快捷登陆
			</text>
			<view class="privacy">
				<image :src="`${$http_cos}/static/privacy.png`"></image>
			</view>
		</button>
		<view class="look">
			<!-- <text>随便看看</text> -->
		</view>
		<view class="u-flex-x-center tit_black agreed" @click="is_agree=!is_agree">
			<view class="pitch_on">
				<image
					:src="is_agree==false?'https://hl-1316403513.cos.ap-shanghai.myqcloud.com/static/2%20%284%29.png':'https://hl-1316403513.cos.ap-shanghai.myqcloud.com/static/3%20%283%29.png'">
				</image>
			</view>
			<view class="u-flex-x-center">
				<text>同意</text>
				<text style="color: #FF7612;" @click="agreement('用户服务协议')">《用户服务协议》</text>
				<text>和</text>
				<text style="color: #FF7612;" @click="agreement('隐私保护政策')">《隐私保护协议》</text>
			</view>
		</view>
		<yy-notice ref="notice"></yy-notice>
	</view>
</template>

<script>
	import {
		login,
		send_message
	} from '@/common/api.js';
	export default {
		data() {
			return {
				show: false,
				is_agree: false,
				// disabled:false
			}
		},
		onLoad() {
			let code = this.$getUrlParam('code')
			if (code && !uni.getStorageSync('access_token')) {
				this.$userLoginCheck(code).then(res => {
							let currentPage = this.getUrlParam()
							//#ifdef H5
							location.replace(uni.$u.config.baseURL + '/#' + currentPage)
							
							//#endif
							})
						}

					},
					onShow() {

					},
					methods: {
						agreement(item) {
							uni.navigateTo({
								url: '/pagesA/agreement/index?text=' + item
							})
						},
						agree_btn() {

						},
						getUrlParam() {
							let str = window.location.search
							let index = str.indexOf('currentPage=')
							if (index != -1) {
								str = str.match(/currentPage=(\S*)&code/)[1];
								return str
							}
							return str

						},
						login() {
							this.$refs.notice.open()

						}
					}

			}
</script>

<style lang="scss">
	.pages {
		width: 750rpx;
		padding: 0rpx 53rpx 0rpx 46rpx;
		height: 100vh;
		box-sizing: border-box;

		.h1 {

			padding: 72rpx 0;
			box-sizing: border-box;

			text {
				font-size: 50rpx;
				font-weight: bold;
				color: #000000;
			}
		}

		.tick {
			width: 28rpx;
			height: 28rpx;
			margin-right: 17rpx;
		}

		.line_height {
			line-height: 40rpx;

			text {
				color: #000000;

				font-size: 30rpx;
			}
		}

		.login_page {
			width: 484rpx;
			height: 401rpx;
			padding: 60rpx 0 60rpx;
		}

		.btn_login {
			background: #FF7612;
			border-radius: 49rpx;
			color: #fff;
			font-size: 30rpx;
			height: 98rpx;

			.privacy {
				width: 68rpx;
				height: 32rpx;
				margin-left: 10rpx;

				image {
					display: block;
				}
			}
		}

		.look {
			padding: 31rpx 0 40rpx;
			text-align: center;
			box-sizing: border-box;

			text {
				font-size: 28rpx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #9D9D9D;
			}
		}

		.agreed {
			align-items: center;

			text {
				font-size: 26rpx;
				color: #9D9D9D;
				font-weight: 400;
			}

			.pitch_on {
				width: 30rpx;
				height: 30rpx;
				margin-right: 16rpx;

				image {
					width: 100%;
					height: 100%;
					display: block;
				}
			}
		}

		button::after {
			border: none;
		}

	}
</style>
